﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Navigation;
using System.Windows.Shapes;
using anael.Model;
using anael.Data.Model;
using System.ServiceModel.DomainServices.Client;
using anael.neuralNetwork;
using System.Windows.Controls.DataVisualization.Charting;

namespace anael
{
    public partial class About : Page
    {
        IEnumerable<Potential> currentPotential;
        DataProvider data = new DataProvider();

        public About()
        {
            InitializeComponent();
        }

        // Executes when the user navigates to this page.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            
            data.Context.startLearning((bo) =>
            {
                if (bo.Value == true)
                {
                    MessageBox.Show("Calcul Terminé");
                }

            }, null);
          
        }

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            var qry = data.Context.GetCategorieFromPersonQuery(_sexe: 1, _status: 1, _nbrContact: 124, _nbrPhoto: 12, _nbrGroupe: 21);

            data.Context.Load(qry,
                 (s) =>
                 {
                     ColumnSeries col = (ColumnSeries)chart.Series[0];
                     col.ItemsSource = (s as LoadOperation<Potential>).Entities;
                 },
                    null);
        }
    }
}